<template>
  <div class="welcome">
    <!-- <h1>Welcome</h1> -->
    <!-- <button @click="send">发送请求</button>
    <button @click="abort">发送中断请求</button> -->
    <el-table :data="tableData" style="width: 100%" height="800">
      <el-table-column prop="username" label="登入账户" width="160">
      </el-table-column>
      <el-table-column prop="lastLogin.ip" label="上次登入ip" width="200">
      </el-table-column>
      <el-table-column
        prop="lastLogin.loginTime"
        label="上次登入时间"
        width="300"
      >
      </el-table-column>
      <el-table-column prop="nowLogin.ip" label="本次登入ip" width="120">
      </el-table-column>
      <el-table-column
        prop="nowLogin.loginTime"
        label="本次登入时间"
        width="300"
      >
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
// // 发送中断请求
// import { getLoginLog } from "@/api";
// export default {
//   data(){
//     return{
//       msg:[]
//     }
//   },
//   methods: {
//     send() {
//       getLoginLog(this).then(res => {
//         console.log(res);
//       });
//     },
//     abort() {
//       if (typeof this.cancel === "function") {
//         this.cancel();
//       }
//     }
//   }
// };
import { getLoginLog } from "@/api";
export default {
  data() {
    return {
      tableData: []
    };
  },
  created() {
    getLoginLog(this).then(res => {
      this.tableData = res.data.data;
    });
  }
};
</script>
<style>
.welcome {
  margin-top: 20px;
  width: 100%;
  height: 100%;
  background-size: 100%;
  background-repeat: no-repeat;
}
.el-table__header-wrapper {
  height: 100px;
  line-height: 100px;
}
</style>
